﻿using System;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;

using SBPweb.PROvibe.Shared.Library.Components;

namespace SBPweb.PROvibe.Server.Library.Contracts
{

    [DataContract]
    public class ServerModule : Module
    {

        [IgnoreDataMember]
        public virtual ReadOnlyCollection<IService> Services
        {
            get;
            protected set;
        }

        [DataMember]
        public override string Path
        {
            get
            {
                lock (this)
                {
                    if (string.IsNullOrEmpty(base.Path))
                    {
                        base.Path = this.GetType().Assembly.Location;
                        base.Path = ".\\" + base.Path.Substring(base.Path.LastIndexOf("\\") + 1);
                    }
                    return base.Path;
                }
            }
            protected set
            {
                base.Path = value;
            }
        }

    }

}